import request from '@/utils/request'

export default{

    // 1. 根据课程id 获取章节和小结数据
    getAllChapterVideo(courseId){
        return request({
            url: `/eduservice/edu-chapter/getChapterVideo/${courseId}`,
            method: 'get',
          })
    },
    // 2. 添加章节
    addChapter(chapter){
        return request({
            url: `/eduservice/edu-chapter/addChapter`,
            method: 'post',
            data: chapter
          })
    },
    // 3. 根据章节id查寻章节
    getChapter(chapterId){
        return request({
            url: `/eduservice/edu-chapter/getChapterInfo/${chapterId}`,
            method: 'get',
          })
    },
    // 4.修改
    updateChapter(chapter){
        return request({
            url: `/eduservice/edu-chapter/updateChapter`,
            method: 'post',
            data: chapter
          })
    },

    // 5. 删除章节
    deletChapter(chapterId){
        return request({
            url: `/eduservice/edu-chapter/${chapterId}`,
            method: 'delete',
          })
    },

}

